package com.group7.mall.req;

import lombok.Data;
import lombok.ToString;

@Data
@ToString
public class MessagePageRequest {

    private String fromUserId;

    private String toUserId;

    private Integer pageSize = 20;

    private Integer lastMessageId = null;
}

//<select id="selectChatRecords" resultType="com.group7.mall.entity.TbMessage">
//        SELECT
//        message_id, from_user_id, to_user_id, message, time_stamp, message_type, is_read
//        WHERE
//        (from_user_id = #{fromUserId} AND to_user_id = #{toUserId})
//        OR
//        (from_user_id = #{toUserId} AND to_user_id = #{fromUserId})
//<if test="lastMessageId != null">
//        AND message_id > #{lastMessageId}
//</if>
//        ORDER BY
//        time_stamp DESC
//        LIMIT
//        20
//</select>